let todoLikeMinxin = {
	methods: {
		// 点赞或取消点赞
		async clickLike(item) {
			// 判断是否处于登录状态
			if (!this.loginState) {
				this.$refs.login.openLogin()
				return
			}
			// 动态点赞或者取消点赞的操作
			if (item.has_like) {
				--item.like_count,
					item.has_like = false,
					await unlikeThisFeed({
						id: item.id
					})
				uni.showToast({
					title: "取消点赞",
					icon: "success",
					duration: 1000,
				})
			} else {
				++item.like_count;
				item.has_like = true;
				await likeThisFeed({
					id: item.id,
				})
				uni.showToast({
					title: "点赞成功",
					icon: "success",
					duration: 1000,
				})
			}
			uni.$emit('indexFeedLoveChange', item)
			uni.$emit('myFeedLoveChange', item)
		}
	}
}
export default todoLikeMinxin
